package com.huanf.media.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huanf.domain.entity.MediaProcess;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * (MediaProcess)表数据库访问层
 *
 * @author makejava
 * @since 2024-04-15 22:18:38
 */
@Mapper
public interface MediaProcessMapper extends BaseMapper<MediaProcess> {

    List<MediaProcess> selectListByShardIndex(@Param("shardTotal") int shardTotal ,@Param("shardIndex") int shardIndex ,@Param("count") int count);

    /**
     * 启动任务 利用数据库实现乐观锁 谁抢到锁谁执行任务
     * @param id
     * @return
     */
    int startTask(@Param("id") Long id);
}
